import { useEntityManager } from "./plugin";
export const wechatConfig = async (headers: any) => {
    const appid = headers.appid || headers.APPID;
    if (!appid) {
        return await useEntityManager(async m => {
            return await m.query(`select appid,secret from wx_account where is_default=$1`, [true])
        })
    }
    // get the appid
    return await useEntityManager(async m => {
        return await m.query(`select appid,secret from wx_account where appid=$1`, [appid])
    })
}
